package com.instant.dal.model;

import java.util.ArrayList;
import java.util.List;

public class MacroExample {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public MacroExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(Integer value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(Integer value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(Integer value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(Integer value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(Integer value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<Integer> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<Integer> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(Integer value1, Integer value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(Integer value1, Integer value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andMacroNameIsNull() {
            addCriterion("macro_name is null");
            return (Criteria) this;
        }

        public Criteria andMacroNameIsNotNull() {
            addCriterion("macro_name is not null");
            return (Criteria) this;
        }

        public Criteria andMacroNameEqualTo(String value) {
            addCriterion("macro_name =", value, "macroName");
            return (Criteria) this;
        }

        public Criteria andMacroNameNotEqualTo(String value) {
            addCriterion("macro_name <>", value, "macroName");
            return (Criteria) this;
        }

        public Criteria andMacroNameGreaterThan(String value) {
            addCriterion("macro_name >", value, "macroName");
            return (Criteria) this;
        }

        public Criteria andMacroNameGreaterThanOrEqualTo(String value) {
            addCriterion("macro_name >=", value, "macroName");
            return (Criteria) this;
        }

        public Criteria andMacroNameLessThan(String value) {
            addCriterion("macro_name <", value, "macroName");
            return (Criteria) this;
        }

        public Criteria andMacroNameLessThanOrEqualTo(String value) {
            addCriterion("macro_name <=", value, "macroName");
            return (Criteria) this;
        }

        public Criteria andMacroNameLike(String value) {
            addCriterion("macro_name like", value, "macroName");
            return (Criteria) this;
        }

        public Criteria andMacroNameNotLike(String value) {
            addCriterion("macro_name not like", value, "macroName");
            return (Criteria) this;
        }

        public Criteria andMacroNameIn(List<String> values) {
            addCriterion("macro_name in", values, "macroName");
            return (Criteria) this;
        }

        public Criteria andMacroNameNotIn(List<String> values) {
            addCriterion("macro_name not in", values, "macroName");
            return (Criteria) this;
        }

        public Criteria andMacroNameBetween(String value1, String value2) {
            addCriterion("macro_name between", value1, value2, "macroName");
            return (Criteria) this;
        }

        public Criteria andMacroNameNotBetween(String value1, String value2) {
            addCriterion("macro_name not between", value1, value2, "macroName");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatIsNull() {
            addCriterion("macro_repeat is null");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatIsNotNull() {
            addCriterion("macro_repeat is not null");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatEqualTo(String value) {
            addCriterion("macro_repeat =", value, "macroRepeat");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatNotEqualTo(String value) {
            addCriterion("macro_repeat <>", value, "macroRepeat");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatGreaterThan(String value) {
            addCriterion("macro_repeat >", value, "macroRepeat");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatGreaterThanOrEqualTo(String value) {
            addCriterion("macro_repeat >=", value, "macroRepeat");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatLessThan(String value) {
            addCriterion("macro_repeat <", value, "macroRepeat");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatLessThanOrEqualTo(String value) {
            addCriterion("macro_repeat <=", value, "macroRepeat");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatLike(String value) {
            addCriterion("macro_repeat like", value, "macroRepeat");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatNotLike(String value) {
            addCriterion("macro_repeat not like", value, "macroRepeat");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatIn(List<String> values) {
            addCriterion("macro_repeat in", values, "macroRepeat");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatNotIn(List<String> values) {
            addCriterion("macro_repeat not in", values, "macroRepeat");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatBetween(String value1, String value2) {
            addCriterion("macro_repeat between", value1, value2, "macroRepeat");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatNotBetween(String value1, String value2) {
            addCriterion("macro_repeat not between", value1, value2, "macroRepeat");
            return (Criteria) this;
        }

        public Criteria andMacroKeyNumIsNull() {
            addCriterion("macro_key_num is null");
            return (Criteria) this;
        }

        public Criteria andMacroKeyNumIsNotNull() {
            addCriterion("macro_key_num is not null");
            return (Criteria) this;
        }

        public Criteria andMacroKeyNumEqualTo(String value) {
            addCriterion("macro_key_num =", value, "macroKeyNum");
            return (Criteria) this;
        }

        public Criteria andMacroKeyNumNotEqualTo(String value) {
            addCriterion("macro_key_num <>", value, "macroKeyNum");
            return (Criteria) this;
        }

        public Criteria andMacroKeyNumGreaterThan(String value) {
            addCriterion("macro_key_num >", value, "macroKeyNum");
            return (Criteria) this;
        }

        public Criteria andMacroKeyNumGreaterThanOrEqualTo(String value) {
            addCriterion("macro_key_num >=", value, "macroKeyNum");
            return (Criteria) this;
        }

        public Criteria andMacroKeyNumLessThan(String value) {
            addCriterion("macro_key_num <", value, "macroKeyNum");
            return (Criteria) this;
        }

        public Criteria andMacroKeyNumLessThanOrEqualTo(String value) {
            addCriterion("macro_key_num <=", value, "macroKeyNum");
            return (Criteria) this;
        }

        public Criteria andMacroKeyNumLike(String value) {
            addCriterion("macro_key_num like", value, "macroKeyNum");
            return (Criteria) this;
        }

        public Criteria andMacroKeyNumNotLike(String value) {
            addCriterion("macro_key_num not like", value, "macroKeyNum");
            return (Criteria) this;
        }

        public Criteria andMacroKeyNumIn(List<String> values) {
            addCriterion("macro_key_num in", values, "macroKeyNum");
            return (Criteria) this;
        }

        public Criteria andMacroKeyNumNotIn(List<String> values) {
            addCriterion("macro_key_num not in", values, "macroKeyNum");
            return (Criteria) this;
        }

        public Criteria andMacroKeyNumBetween(String value1, String value2) {
            addCriterion("macro_key_num between", value1, value2, "macroKeyNum");
            return (Criteria) this;
        }

        public Criteria andMacroKeyNumNotBetween(String value1, String value2) {
            addCriterion("macro_key_num not between", value1, value2, "macroKeyNum");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatTypeIsNull() {
            addCriterion("macro_repeat_type is null");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatTypeIsNotNull() {
            addCriterion("macro_repeat_type is not null");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatTypeEqualTo(String value) {
            addCriterion("macro_repeat_type =", value, "macroRepeatType");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatTypeNotEqualTo(String value) {
            addCriterion("macro_repeat_type <>", value, "macroRepeatType");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatTypeGreaterThan(String value) {
            addCriterion("macro_repeat_type >", value, "macroRepeatType");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatTypeGreaterThanOrEqualTo(String value) {
            addCriterion("macro_repeat_type >=", value, "macroRepeatType");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatTypeLessThan(String value) {
            addCriterion("macro_repeat_type <", value, "macroRepeatType");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatTypeLessThanOrEqualTo(String value) {
            addCriterion("macro_repeat_type <=", value, "macroRepeatType");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatTypeLike(String value) {
            addCriterion("macro_repeat_type like", value, "macroRepeatType");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatTypeNotLike(String value) {
            addCriterion("macro_repeat_type not like", value, "macroRepeatType");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatTypeIn(List<String> values) {
            addCriterion("macro_repeat_type in", values, "macroRepeatType");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatTypeNotIn(List<String> values) {
            addCriterion("macro_repeat_type not in", values, "macroRepeatType");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatTypeBetween(String value1, String value2) {
            addCriterion("macro_repeat_type between", value1, value2, "macroRepeatType");
            return (Criteria) this;
        }

        public Criteria andMacroRepeatTypeNotBetween(String value1, String value2) {
            addCriterion("macro_repeat_type not between", value1, value2, "macroRepeatType");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}